package net.oschina.dajiangnan.wx.qr.serializable;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import net.oschina.dajiangnan.wx.process.pay.bean.Product;


public class Products implements Serializable {
    private static final long serialVersionUID = 8714698643988477492L;
    private List<Product> products = new ArrayList<Product>();
    
    public List<Product> getProducts() {
        return products;
    }
    public void setProducts(List<Product> products) {
        this.products = products;
    }
    public Product getProduct(String productid){
        for(Product product : products){
            if(product.getProductid().equals(productid)){
                return product;
            }
        }
        return null;
    }
    public String toString(){
        String productids = "";
        for(Product product : products){
            productids += product.getProductid()+",";
        }
        return productids;
    }
}
